﻿namespace Hazza.UserInput.Models
{
    public class InputRecord
    {
        public InputRecord(string[] a, int[] i) {
            AnswersIndex = EncodeIndexes(i);
            Answers = EncodeAnswers(a);
        }

        public int Id { get; set; }
        public int UserId { get; set; }
        public int QuestionId { get; set; }
        public int ContainerId { get; set; }
        // Do we need this for simple marking?
        public int FirstAnswerIndex { get; set; }
        public string AnswersIndex { get; private set; }
        public string FirstAnswer { get; set; }
        public string Answers { get; private set; }

        public int[] AnswersIndexArray
        {
            get { return DecodeIndexes(AnswersIndex); }
        }

        public string[] AnswersArray
        {
            get { return DecodeAnswers(Answers); }
        }

        #region Helpers
        private string EncodeIndexes(int[] ids) {
            return "";
        }

        private int[] DecodeIndexes(string ids) {
            return null;
        }

        private string EncodeAnswers(string[] answers) {
            return "";
        }

        private string[] DecodeAnswers(string answers) {
            return null;
        }
        #endregion
    }
}